import request from '@/utils/request'

const api_name = '/teach/teacher';
export default {
  //1 分页查询所有讲师
  queryPageList(current, limit, teacherQuery) {
    return request({
      url: `${api_name}/pageQueryList/${current}/${limit}`,
      method: 'post',
      data: teacherQuery
    })
  },

  //2 逻辑删除讲师id
  removeTeacherById(id) {
    return request({
      url: `${api_name}/removeById/${id}`,
      method: 'delete'
    })
  },

  //3 添加讲师
  saveTeacher(teacherForm) {
    return request({
      url: `${api_name}/saveTeacher`,
      method: 'post',
      data: teacherForm
    })
  },

  //4 根据讲师id查询讲师信息
  getById(id) {
    return request({
      url: `${api_name}/getTeacherById/${id}`,
      method: 'get',
    })
  },

  //修改讲师
  updateTeacher(teacherForm) {
    return request({
      url: `${api_name}/updateTeacher`,
      method: 'put',
      data: teacherForm
    })
  },

  //讲师列表
  getList() {
    return request({
      url: `${api_name}/findAll`,
      method: 'get',
    })
  }
}
